//
//  Data.m
//  22-TTPOD
//
//  Created by dllo on 16/8/13.
//  Copyright © 2016年 ZHW. All rights reserved.
//

#import "Data.h"
#import "SmallData.h"
#import "Action.h"
@implementation Data
- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"data"]) {
        NSMutableArray<SmallData *> *dataArray = [NSMutableArray array];
        for (NSDictionary *dic in _data) {
            SmallData *smallData = [SmallData modelWithDic:dic];
            [dataArray addObject:smallData];
        }
        _data = dataArray;
    }
    if ([key isEqualToString:@"action"]) {
        _action = [Action modelWithDic:value];
    }
}
@end
